rmagick 1.7.1

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.

Files changed (239) hide show
  1. data/ChangeLog +232 -0
  2. data/Makefile.in +28 -0
  3. data/README.html +404 -0
  4. data/README.txt +397 -0
  5. data/configure +8554 -0
  6. data/configure.ac +497 -0
  7. data/doc/comtasks.html +241 -0
  8. data/doc/constants.html +1195 -0
  9. data/doc/css/doc.css +299 -0
  10. data/doc/css/popup.css +34 -0
  11. data/doc/draw.html +3108 -0
  12. data/doc/ex/Adispatch.rb +43 -0
  13. data/doc/ex/Zconstitute.rb +9 -0
  14. data/doc/ex/adaptive_threshold.rb +19 -0
  15. data/doc/ex/add_noise.rb +18 -0
  16. data/doc/ex/affine.rb +48 -0
  17. data/doc/ex/affine_transform.rb +20 -0
  18. data/doc/ex/arc.rb +47 -0
  19. data/doc/ex/arcpath.rb +33 -0
  20. data/doc/ex/average.rb +15 -0
  21. data/doc/ex/axes.rb +64 -0
  22. data/doc/ex/bilevel_channel.rb +20 -0
  23. data/doc/ex/blur_image.rb +12 -0
  24. data/doc/ex/border.rb +10 -0
  25. data/doc/ex/bounding_box.rb +48 -0
  26. data/doc/ex/cbezier1.rb +40 -0
  27. data/doc/ex/cbezier2.rb +40 -0
  28. data/doc/ex/cbezier3.rb +40 -0
  29. data/doc/ex/cbezier4.rb +41 -0
  30. data/doc/ex/cbezier5.rb +41 -0
  31. data/doc/ex/cbezier6.rb +51 -0
  32. data/doc/ex/channel.rb +26 -0
  33. data/doc/ex/channel_threshold.rb +48 -0
  34. data/doc/ex/charcoal.rb +12 -0
  35. data/doc/ex/chop.rb +29 -0
  36. data/doc/ex/circle.rb +31 -0
  37. data/doc/ex/clip_path.rb +56 -0
  38. data/doc/ex/coalesce.rb +60 -0
  39. data/doc/ex/color_fill_to_border.rb +29 -0
  40. data/doc/ex/color_floodfill.rb +28 -0
  41. data/doc/ex/color_histogram.rb +60 -0
  42. data/doc/ex/color_reset.rb +11 -0
  43. data/doc/ex/colorize.rb +16 -0
  44. data/doc/ex/colors.rb +65 -0
  45. data/doc/ex/composite.rb +135 -0
  46. data/doc/ex/contrast.rb +37 -0
  47. data/doc/ex/crop.rb +31 -0
  48. data/doc/ex/crop_with_gravity.rb +46 -0
  49. data/doc/ex/cycle_colormap.rb +21 -0
  50. data/doc/ex/demo.rb +324 -0
  51. data/doc/ex/drawcomp.rb +42 -0
  52. data/doc/ex/drop_shadow.rb +60 -0
  53. data/doc/ex/edge.rb +11 -0
  54. data/doc/ex/ellipse.rb +43 -0
  55. data/doc/ex/emboss.rb +11 -0
  56. data/doc/ex/enhance.rb +28 -0
  57. data/doc/ex/equalize.rb +11 -0
  58. data/doc/ex/flatten_images.rb +38 -0
  59. data/doc/ex/flip.rb +11 -0
  60. data/doc/ex/flop.rb +11 -0
  61. data/doc/ex/fonts.rb +20 -0
  62. data/doc/ex/frame.rb +12 -0
  63. data/doc/ex/gaussian_blur.rb +11 -0
  64. data/doc/ex/get_multiline_type_metrics.rb +53 -0
  65. data/doc/ex/get_pixels.rb +48 -0
  66. data/doc/ex/get_type_metrics.rb +140 -0
  67. data/doc/ex/gradientfill.rb +27 -0
  68. data/doc/ex/grav.rb +44 -0
  69. data/doc/ex/gravity.rb +80 -0
  70. data/doc/ex/hatchfill.rb +27 -0
  71. data/doc/ex/images/Ballerina.jpg +0 -0
  72. data/doc/ex/images/Ballerina3.jpg +0 -0
  73. data/doc/ex/images/Button_0.gif +0 -0
  74. data/doc/ex/images/Button_1.gif +0 -0
  75. data/doc/ex/images/Button_2.gif +0 -0
  76. data/doc/ex/images/Button_3.gif +0 -0
  77. data/doc/ex/images/Button_4.gif +0 -0
  78. data/doc/ex/images/Button_5.gif +0 -0
  79. data/doc/ex/images/Button_6.gif +0 -0
  80. data/doc/ex/images/Button_7.gif +0 -0
  81. data/doc/ex/images/Button_8.gif +0 -0
  82. data/doc/ex/images/Button_9.gif +0 -0
  83. data/doc/ex/images/Button_A.gif +0 -0
  84. data/doc/ex/images/Button_B.gif +0 -0
  85. data/doc/ex/images/Button_C.gif +0 -0
  86. data/doc/ex/images/Button_D.gif +0 -0
  87. data/doc/ex/images/Button_E.gif +0 -0
  88. data/doc/ex/images/Button_F.gif +0 -0
  89. data/doc/ex/images/Button_G.gif +0 -0
  90. data/doc/ex/images/Button_H.gif +0 -0
  91. data/doc/ex/images/Button_I.gif +0 -0
  92. data/doc/ex/images/Button_J.gif +0 -0
  93. data/doc/ex/images/Button_K.gif +0 -0
  94. data/doc/ex/images/Button_L.gif +0 -0
  95. data/doc/ex/images/Button_M.gif +0 -0
  96. data/doc/ex/images/Button_N.gif +0 -0
  97. data/doc/ex/images/Button_O.gif +0 -0
  98. data/doc/ex/images/Button_P.gif +0 -0
  99. data/doc/ex/images/Button_Q.gif +0 -0
  100. data/doc/ex/images/Button_R.gif +0 -0
  101. data/doc/ex/images/Button_S.gif +0 -0
  102. data/doc/ex/images/Button_T.gif +0 -0
  103. data/doc/ex/images/Button_U.gif +0 -0
  104. data/doc/ex/images/Button_V.gif +0 -0
  105. data/doc/ex/images/Button_W.gif +0 -0
  106. data/doc/ex/images/Button_X.gif +0 -0
  107. data/doc/ex/images/Button_Y.gif +0 -0
  108. data/doc/ex/images/Button_Z.gif +0 -0
  109. data/doc/ex/images/Cheetah.jpg +0 -0
  110. data/doc/ex/images/Coffee.wmf +0 -0
  111. data/doc/ex/images/Flower_Hat.jpg +0 -0
  112. data/doc/ex/images/Gold_Statue.jpg +0 -0
  113. data/doc/ex/images/Hot_Air_Balloons.jpg +0 -0
  114. data/doc/ex/images/Hot_Air_Balloons_H.jpg +0 -0
  115. data/doc/ex/images/No.wmf +0 -0
  116. data/doc/ex/images/Polynesia.jpg +0 -0
  117. data/doc/ex/images/Red_Rocks.jpg +0 -0
  118. data/doc/ex/images/Shorts.jpg +0 -0
  119. data/doc/ex/images/Snake.wmf +0 -0
  120. data/doc/ex/images/Violin.jpg +0 -0
  121. data/doc/ex/images/graydient230x6.gif +0 -0
  122. data/doc/ex/images/logo400x83.gif +0 -0
  123. data/doc/ex/images/model.miff +0 -0
  124. data/doc/ex/images/notimplemented.gif +0 -0
  125. data/doc/ex/images/smile.miff +0 -0
  126. data/doc/ex/images/spin.gif +0 -0
  127. data/doc/ex/implode.rb +32 -0
  128. data/doc/ex/level.rb +12 -0
  129. data/doc/ex/level_channel.rb +33 -0
  130. data/doc/ex/line.rb +40 -0
  131. data/doc/ex/map.rb +28 -0
  132. data/doc/ex/map_f.rb +15 -0
  133. data/doc/ex/matte_fill_to_border.rb +42 -0
  134. data/doc/ex/matte_floodfill.rb +35 -0
  135. data/doc/ex/matte_replace.rb +42 -0
  136. data/doc/ex/median_filter.rb +28 -0
  137. data/doc/ex/modulate.rb +11 -0
  138. data/doc/ex/mono.rb +23 -0
  139. data/doc/ex/morph.rb +26 -0
  140. data/doc/ex/mosaic.rb +35 -0
  141. data/doc/ex/motion_blur.rb +11 -0
  142. data/doc/ex/negate.rb +11 -0
  143. data/doc/ex/negate_channel.rb +19 -0
  144. data/doc/ex/normalize.rb +11 -0
  145. data/doc/ex/oil_paint.rb +11 -0
  146. data/doc/ex/opacity.rb +38 -0
  147. data/doc/ex/opaque.rb +14 -0
  148. data/doc/ex/ordered_dither.rb +11 -0
  149. data/doc/ex/path.rb +62 -0
  150. data/doc/ex/pattern1.rb +25 -0
  151. data/doc/ex/pattern2.rb +26 -0
  152. data/doc/ex/polygon.rb +24 -0
  153. data/doc/ex/polyline.rb +23 -0
  154. data/doc/ex/posterize.rb +19 -0
  155. data/doc/ex/preview.rb +16 -0
  156. data/doc/ex/qbezierpath.rb +49 -0
  157. data/doc/ex/quantize-m.rb +25 -0
  158. data/doc/ex/radial_blur.rb +19 -0
  159. data/doc/ex/raise.rb +11 -0
  160. data/doc/ex/random_channel_threshold.rb +17 -0
  161. data/doc/ex/random_threshold_channel.rb +18 -0
  162. data/doc/ex/rectangle.rb +33 -0
  163. data/doc/ex/reduce_noise.rb +28 -0
  164. data/doc/ex/roll.rb +9 -0
  165. data/doc/ex/rotate.rb +43 -0
  166. data/doc/ex/rotate_f.rb +14 -0
  167. data/doc/ex/roundrect.rb +32 -0
  168. data/doc/ex/rubyname.rb +31 -0
  169. data/doc/ex/segment.rb +11 -0
  170. data/doc/ex/shade.rb +11 -0
  171. data/doc/ex/shave.rb +15 -0
  172. data/doc/ex/shear.rb +10 -0
  173. data/doc/ex/skewx.rb +50 -0
  174. data/doc/ex/skewy.rb +45 -0
  175. data/doc/ex/smile.rb +124 -0
  176. data/doc/ex/solarize.rb +11 -0
  177. data/doc/ex/splice.rb +16 -0
  178. data/doc/ex/spread.rb +11 -0
  179. data/doc/ex/stegano.rb +50 -0
  180. data/doc/ex/stroke_dasharray.rb +41 -0
  181. data/doc/ex/stroke_linecap.rb +44 -0
  182. data/doc/ex/stroke_linejoin.rb +48 -0
  183. data/doc/ex/stroke_width.rb +47 -0
  184. data/doc/ex/swirl.rb +17 -0
  185. data/doc/ex/text.rb +32 -0
  186. data/doc/ex/text_align.rb +36 -0
  187. data/doc/ex/text_antialias.rb +33 -0
  188. data/doc/ex/text_undercolor.rb +26 -0
  189. data/doc/ex/texture_fill_to_border.rb +34 -0
  190. data/doc/ex/texture_floodfill.rb +31 -0
  191. data/doc/ex/texturefill.rb +25 -0
  192. data/doc/ex/threshold.rb +13 -0
  193. data/doc/ex/to_blob.rb +14 -0
  194. data/doc/ex/translate.rb +37 -0
  195. data/doc/ex/transparent.rb +38 -0
  196. data/doc/ex/trim.rb +25 -0
  197. data/doc/ex/unsharp_mask.rb +28 -0
  198. data/doc/ex/viewex.rb +36 -0
  199. data/doc/ex/wave.rb +9 -0
  200. data/doc/ilist.html +1592 -0
  201. data/doc/image1.html +3009 -0
  202. data/doc/image2.html +2169 -0
  203. data/doc/image3.html +2815 -0
  204. data/doc/imageattrs.html +1319 -0
  205. data/doc/imusage.html +403 -0
  206. data/doc/index.html +418 -0
  207. data/doc/info.html +949 -0
  208. data/doc/magick.html +439 -0
  209. data/doc/scripts/doc.js +9 -0
  210. data/doc/struct.html +1334 -0
  211. data/doc/usage.html +1318 -0
  212. data/examples/describe.rb +44 -0
  213. data/examples/histogram.rb +289 -0
  214. data/examples/image_opacity.rb +29 -0
  215. data/examples/import_export.rb +31 -0
  216. data/examples/pattern_fill.rb +38 -0
  217. data/examples/rotating_text.rb +47 -0
  218. data/examples/thumbnail.rb +65 -0
  219. data/examples/vignette.rb +79 -0
  220. data/ext/RMagick/MANIFEST +239 -0
  221. data/ext/RMagick/extconf.rb.in +21 -0
  222. data/ext/RMagick/rmagick.h +938 -0
  223. data/ext/RMagick/rmagick_config.h.in +170 -0
  224. data/ext/RMagick/rmdraw.c +1308 -0
  225. data/ext/RMagick/rmfill.c +609 -0
  226. data/ext/RMagick/rmilist.c +685 -0
  227. data/ext/RMagick/rmimage.c +7980 -0
  228. data/ext/RMagick/rminfo.c +982 -0
  229. data/ext/RMagick/rmmain.c +1497 -0
  230. data/ext/RMagick/rmutil.c +2685 -0
  231. data/install.rb +1015 -0
  232. data/lib/RMagick.rb +1486 -0
  233. data/metaconfig.in +6 -0
  234. data/post-clean.rb +12 -0
  235. data/post-install.rb +36 -0
  236. data/post-setup.rb +245 -0
  237. data/rmagick.gemspec +22 -0
  238. data/uninstall.rb +71 -0
  239. metadata +286 -0
data/doc/imusage.html ADDED
@@ -0,0 +1,403 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
+
4
+ <html xmlns="http://www.w3.org/1999/xhtml">
5
+ <head>
6
+ <meta name="generator" content=
7
+ "HTML Tidy for Linux/x86 (vers 1st September 2004), see www.w3.org" />
8
+
9
+ <title>RMagick: ImageMagick/GraphicsMagick Conventions</title>
10
+ <meta http-equiv="Content-Type" content=
11
+ "text/html; charset=us-ascii" />
12
+ <meta name="GENERATOR" content="Quanta Plus" />
13
+ <meta name="Copyright" content=
14
+ "Copyright (C) 2004 by Timothy P. Hunter" />
15
+ <link rel="stylesheet" type="text/css" href="css/doc.css" />
16
+ <script type="text/javascript" src="scripts/doc.js">
17
+ </script>
18
+ <style type="text/css">
19
+ /*<![CDATA[*/
20
+
21
+ /* Styles local to this page. */
22
+ /*
23
+ * Modify the example style for the scripts on this page.
24
+ */
25
+ .example {
26
+ margin-left: 100px;
27
+ margin-right: 100px;
28
+ margin-bottom: 1em;
29
+ }
30
+ #rgbfmts {
31
+ border-collapse: separate;
32
+ border-spacing: 0;
33
+ border: thin solid black;
34
+ background-color: #f0f0f0;
35
+ margin: 1em auto 1em auto;
36
+ width: 70%;
37
+ }
38
+ #rgbfmts td {
39
+ padding: 3px 1em 3px 1em;
40
+ border-width: 0;
41
+ }
42
+ #rgbfmts caption {
43
+ font-weight: bold;
44
+ }
45
+ .evenrow {
46
+ background-color: #f0f0f0;
47
+ }
48
+ .oddrow {
49
+ background-color: white;
50
+ }
51
+ #geostr {
52
+ width:100%;
53
+ font-weight: bold;
54
+ text-align: center;
55
+ }
56
+ #bi_format_list {
57
+ margin-left: 100px;
58
+ }
59
+ #bi_format_list h4 {
60
+ padding-left: 5px;
61
+ position: relative;
62
+ left: -100px;
63
+ background-image: url(graydient210x6.gif);
64
+ background-repeat: repeat-y;
65
+ }
66
+
67
+ /*]]>*/
68
+ </style>
69
+ </head>
70
+
71
+ <body>
72
+ <h6 id="header">RMagick User's Guide and Reference</h6>
73
+
74
+ <div class="nav">
75
+ &laquo;&nbsp;<a href="usage.html">Prev</a> | <a href=
76
+ "index.html">Contents</a> | <a href=
77
+ "comtasks.html">Next</a>&nbsp;&raquo;
78
+ </div>
79
+
80
+ <h1>RMagick: ImageMagick/GraphicsMagick Conventions</h1>
81
+
82
+ <div id="toc">
83
+ <h2>Table of Contents</h2>
84
+
85
+ <ul style="margin-left: 15px; padding-top: 1em">
86
+ <li><a href="#formats">Image formats and filenames</a></li>
87
+
88
+ <li><a href="#color_names">Color names</a></li>
89
+
90
+ <li><a href="#geometry">The geometry string</a></li>
91
+
92
+ <li><a href="#classtype">DirectClass and PseudoClass</a></li>
93
+
94
+ <li><a href="#builtin_formats">Built-in image
95
+ formats</a></li>
96
+ </ul>
97
+ </div>
98
+
99
+ <h2 id="formats">Image formats and filenames</h2>
100
+
101
+ <p>&times;Magick supports over 89 major <a href=
102
+ "http://www.imagemagick.org/www/formats.html">image
103
+ formats</a>.</p>
104
+
105
+ <p>&times;Magick determines the format (GIF, PNG, JPEG, etc.) of
106
+ an image file either from its magic number, the filename suffix
107
+ (.gif, .png, .jpg) or from a prefix attached to the filename. For
108
+ example, <code>ps:mydoc</code> indicates that <code>mydoc</code>
109
+ is a Postscript file. <span class="imquote">The magic number
110
+ takes precedence over the filename suffix and the prefix takes
111
+ precedence over the magic number and the suffix in input files.
112
+ The prefix takes precedence over the filename suffix in output
113
+ files.</span></p>
114
+
115
+ <p>This makes it easy to convert an image file to another format.
116
+ Simply write the image file using a name that has either a prefix
117
+ or a suffix corresponding to the format you want.</p>
118
+
119
+ <p><em>Note:</em> Keep in mind that files in some formats may
120
+ only be read by &times;Magick, not written.</p>
121
+
122
+ <h2 id="color_names">Color names</h2>
123
+
124
+ <p>Many RMagick methods expect color name arguments or return
125
+ color names. A color name can be</p>
126
+
127
+ <ol>
128
+ <li>an X color name such as "red", "chocolate", or
129
+ "lightslategray". (On Linux and FreeBSD, the master list is
130
+ usually <code>/usr/X11R6/lib/X11/rgb.txt</code>.)</li>
131
+
132
+ <li>an <a href=
133
+ "http://www.w3.org/TR/SVG/types.html#ColorKeywords">SVG color
134
+ name</a> (similar to the X color names), or</li>
135
+
136
+ <li>a hex digit string in one of the formats shown in the
137
+ following table.</li>
138
+ </ol>
139
+
140
+ <table id="rgbfmts" summary="RGB formats">
141
+ <caption>
142
+ RGB color name formats
143
+ </caption>
144
+
145
+ <tr class="oddrow">
146
+ <td>#RGB</td>
147
+
148
+ <td>4 bits for each channel</td>
149
+ </tr>
150
+
151
+ <tr class="evenrow">
152
+ <td>#RRGGBB</td>
153
+
154
+ <td>8 bits for each channel</td>
155
+ </tr>
156
+
157
+ <tr class="oddrow">
158
+ <td>#RRRGGGBBB</td>
159
+
160
+ <td>12 bits for each channel</td>
161
+ </tr>
162
+
163
+ <tr class="evenrow">
164
+ <td>#RRRRGGGGBBBB</td>
165
+
166
+ <td>16 bits for each channel</td>
167
+ </tr>
168
+
169
+ <tr class="oddrow">
170
+ <td>#RGBA</td>
171
+
172
+ <td>4 bits for each channel, plus the alpha channel</td>
173
+ </tr>
174
+
175
+ <tr class="evenrow">
176
+ <td>#RRGGBBAA</td>
177
+
178
+ <td>8 bits for each channel, plus the alpha channel</td>
179
+ </tr>
180
+
181
+ <tr class="oddrow">
182
+ <td>#RRRGGGBBBAAA</td>
183
+
184
+ <td>12 bits for each channel, plus the alpha channel</td>
185
+ </tr>
186
+
187
+ <tr class="evenrow">
188
+ <td>#RRRRGGGGBBBBAAAA</td>
189
+
190
+ <td>16 bits for each channel, plus the alpha channel</td>
191
+ </tr>
192
+
193
+ <tr class="oddrow">
194
+ <td>rgb(r,g,b)</td>
195
+
196
+ <td>SVG functional notation. r, g, and b are either three
197
+ integers 0-255 or 3 percentanges 0%-100%.</td>
198
+ </tr>
199
+
200
+ <tr class="evenrow">
201
+ <td>rgb(r,g,b,a)</td>
202
+
203
+ <td>SVG functional notation plus the alpha channel.</td>
204
+ </tr>
205
+ </table>
206
+
207
+ <p>The alpha channel is the opacity of the image, which can range
208
+ from 0 (Magick::OpaqueOpacity) to MaxRGB
209
+ (Magick::TransparentOpacity).</p>
210
+
211
+ <p>A <code>Pixel</code> object contains the numeric
212
+ representation of a color. The <a href=
213
+ "struct.html#Pixel.from_color">Pixel.from_color</a> method
214
+ converts a color name to a pixel. There are two methods to
215
+ convert a pixel to a color name. The <a href=
216
+ "struct.html#Pixel.to_color">Pixel#to_color</a> method requires
217
+ that you specify whether the alpha (opacity) channel is used, the
218
+ depth (8 or 16) and the color standard to use. The <a href=
219
+ "image3.html#to_color">Image#to_color</a> method uses the image's
220
+ depth and <a href="imageattrs.html#matte">matte</a> attributes.
221
+ If <code>matte</code> is false the opacity value is ignored.</p>
222
+
223
+ <p><em>Hint:</em> You can specify the transparent color as
224
+ "none", "transparent", or "#000000ff".</p>
225
+
226
+ <p><a href="http://www.imagemagick.org/www/color.html">This</a>
227
+ is ImageMagick's page about color names.</p>
228
+
229
+ <h2 id="geometry">The geometry string</h2>
230
+
231
+ <p>RMagick methods frequently require a <code>geometry</code>
232
+ string argument. This string generally specifies width and height
233
+ values as well as x and y offset values. The values are usually
234
+ specified in pixels (but see the % flag, below).</p>
235
+
236
+ <p>This is the format of the geometry string. Any of the values
237
+ may be omitted, depending on the context:</p>
238
+ <pre id="geostr">
239
+ &lt;width&gt;x&lt;height&gt;+-&lt;x&gt;+-&lt;y&gt;{%@!&lt;&gt;}
240
+ </pre>
241
+
242
+ <p><a href=
243
+ "http://www.imagemagick.org/www/utilities.html">This</a> is the
244
+ ImageMagick description of the geometry string:</p>
245
+
246
+ <div class="imquote">
247
+ <p>By default, the width and height are maximum values. That
248
+ is, the image is expanded or contracted to fit the width and
249
+ height value while maintaining the aspect ratio of the image.
250
+ Append an exclamation point to the geometry to force the image
251
+ size to exactly the size you specify. For example, if you
252
+ specify 640x480! the image width is set to 640 pixels and
253
+ height to 480.</p>
254
+
255
+ <p>If only the width is specified, the width assumes the value
256
+ and the height is chosen to maintain the aspect ratio of the
257
+ image. Similarly, if only the height is specified (e.g.,
258
+ "x256"), the width is chosen to maintain the aspect ratio. To
259
+ specify a percentage width or height instead, append %. The
260
+ image size is multiplied by the width and height percentages to
261
+ obtain the final image dimensions. To increase the size of an
262
+ image, use a value greater than 100 (e.g. 125%). To decrease an
263
+ image's size, use a percentage less than 100.</p>
264
+
265
+ <p>Use @ to specify the maximum area in pixels of an image.</p>
266
+
267
+ <p>Use &gt; to change the dimensions of the image only if its
268
+ width or height exceeds the geometry specification. &lt;
269
+ resizes the image only if both of its dimensions are less than
270
+ the geometry specification. For example, if you specify
271
+ '640x480&gt;' and the image size is 256x256, the image size
272
+ does not change. However, if the image is 512x512 or 1024x1024,
273
+ it is resized to 480x480.</p>
274
+ </div>
275
+
276
+ <p>The x and y offsets, if present, can be preceeded with either
277
+ a + or - sign. The + causes x and y to be measured from the left
278
+ or top edges, respectively. Conversely, - measures from the right
279
+ or bottom edges. Offsets are always measured in pixels.</p>
280
+
281
+ <p>Any method that accepts a geometry string will also accept a
282
+ <a href="struct.html#geometry"><code>Geometry</code></a>
283
+ object.</p>
284
+
285
+ <p>Some RMagick methods interpret the geometry string values
286
+ differently. Where this is the case the documentation for the
287
+ method will explain the differences.</p>
288
+
289
+ <h2 id="classtype">DirectClass and PseudoClass</h2>
290
+
291
+ <p>&times;Magick classifies all images into two <em>classes</em>,
292
+ PseudoClass and DirectClass.</p>
293
+
294
+ <div class="imquote">
295
+ <p>DirectClass images are continuous-tone images stored as RGB
296
+ (red, green, blue), RGBA (red, green, blue, alpha), or CMYK
297
+ (cyan, yellow, magenta, black) intensity values as defined by
298
+ the <code>colorspace</code> [attribute].</p>
299
+
300
+ <p>PseudoClass images are colormapped RGB images. The colormap
301
+ is stored as a series of red, green, and blue pixel values,
302
+ each value being a byte in size. If the image depth is 16, each
303
+ colormap entry consumes two bytes with the most significant
304
+ byte being first. The number of colormap entries is defined by
305
+ the <code>colors</code> [attribute].</p>
306
+ </div>
307
+
308
+ <p>GIF format images are PseudoClass. JPEG format images are
309
+ DirectClass. You can change the class of a image with the
310
+ <code><a href=
311
+ "imageattrs.html#class_type_eq">class_type=</a></code>
312
+ method.</p>
313
+
314
+ <h2 id="builtin_formats">Built-in image formats</h2>
315
+
316
+ <p>Some of the image formats that &times;Magick supports are
317
+ special-purpose formats that are built-in to &times;Magick
318
+ itself. That is, even though you can "read" images in these
319
+ formats, they do not correspond to any real image files.</p>
320
+
321
+ <p>These are the built-in formats that I know something about.
322
+ (There are more but I've never used them.) When the format is
323
+ marked with an <sup>*</sup>, you must supply the desired size of
324
+ the image in order to "read" it. Specify the size by assigning a
325
+ string in the form "WxH" to the <code>size</code> attribute in
326
+ the <code>read</code> method's additional parms block. For
327
+ example, to create a image in the gradient format that is 100
328
+ pixels wide and 200 pixels high, use:</p>
329
+ <pre class="example">
330
+ i = Image.read("gradient:red-blue") { self.size = "100x200" }
331
+ </pre>
332
+
333
+ <p>See <a href="javascript:popup('demo.rb.html')">demo.rb</a> for
334
+ more examples of reading built-in formats.</p>
335
+
336
+ <div id="bi_format_list">
337
+ <h4>gradient<sup>*</sup></h4>
338
+
339
+ <p>Gradient filenames have the form
340
+ <code>"gradient:color1-color2"</code>. These images are created
341
+ by gradually changing from <code>color1</code> at the top edge
342
+ to <code>color2</code> at the bottom. Don't confuse this image
343
+ format with the <a href=
344
+ "struct.html#GradientFill">GradientFill</a> class, which is
345
+ part of RMagick.</p>
346
+
347
+ <h4>granite</h4>
348
+
349
+ <p>A mottled gray image suitable for use as a tiled background
350
+ texture. Ex: <code>"granite:"</code>.</p>
351
+
352
+ <h4>logo</h4>
353
+
354
+ <p>The &times;Magick logo. Ex: <code>"logo:"</code>.</p>
355
+
356
+ <h4>netscape</h4>
357
+
358
+ <p>The 216-color "Web safe" cube. Ex:
359
+ <code>"netscape:"</code>.</p>
360
+
361
+ <h4>null<sup>*</sup></h4>
362
+
363
+ <p>An empty image. Ex: <code>"null:"</code>.</p>
364
+
365
+ <h4>pattern</h4>
366
+
367
+ <p>ImageMagick 5.5.7-3 introduced the <code>pattern:</code>
368
+ format. This format supplies a number of built-in patterns that
369
+ may be referenced by specifying the pattern name. For example,
370
+ <code>pattern:checkerboard</code>. For a list of acceptable
371
+ patterns, see <a href=
372
+ "http://www.imagemagick.org/www/formats.html">this
373
+ page.</a></p>
374
+
375
+ <h4>plasma<sup>*</sup></h4>
376
+
377
+ <p>Creates a swirly, psychedelic image. Specify a pair of
378
+ colors in the filename (<code>"plasma:red-blue"</code>) or
379
+ specify the filename <code>"plasma:fractal"</code> for best
380
+ results.</p>
381
+
382
+ <h4>rose</h4>
383
+
384
+ <p>A small picture of a rose. Ex: <code>"rose:"</code>.</p>
385
+
386
+ <h4>xc<sup>*</sup></h4>
387
+
388
+ <p>Specify a <a href="#color_names">color name</a> after the
389
+ xc: prefix. For example, <code>"xc:red"</code>. This format is
390
+ simply an image of the specified color. You can get exactly the
391
+ same results by specifying the background color when creating
392
+ an image.</p>
393
+ </div>
394
+
395
+ <p class="spacer"> </p>
396
+
397
+ <div class="nav">
398
+ &laquo; <a href="usage.html">Prev</a> | <a href=
399
+ "index.html">Contents</a> | <a href="comtasks.html">Next</a>
400
+ &raquo;
401
+ </div>
402
+ </body>
403
+ </html>
data/doc/index.html ADDED
@@ -0,0 +1,418 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
+
4
+ <html xmlns="http://www.w3.org/1999/xhtml">
5
+ <head>
6
+ <meta name="generator" content=
7
+ "HTML Tidy for Linux/x86 (vers 1st September 2004), see www.w3.org" />
8
+
9
+ <title>RMagick User's Guide and Reference</title>
10
+ <meta http-equiv="Content-Type" content=
11
+ "text/html; charset=us-ascii" />
12
+ <meta name="GENERATOR" content="Quanta Plus" />
13
+ <meta name="Copyright" content=
14
+ "Copyright (C) 2004 by Timothy P. Hunter" />
15
+ <link rel="stylesheet" type="text/css" href="css/doc.css" />
16
+ <style type="text/css">
17
+ /*<![CDATA[*/
18
+
19
+ /* Styles local to this page. */
20
+
21
+ #logo {
22
+ position: absolute;
23
+ top: 0;
24
+ left: 0;
25
+ width: 100%;
26
+ background-color: black;
27
+ margin: 0;
28
+ }
29
+ #logoborder {
30
+ margin: 0;
31
+ padding-left: 10px;
32
+ font-weight: 700;
33
+ font-style: italic;
34
+ background-color: #900;
35
+ color: #c0c0c0;
36
+ }
37
+ #magick {
38
+ position:absolute;
39
+ top: 20px;
40
+ left: 380px;
41
+ padding-left: 15px;
42
+ margin-bottom: 0;
43
+ color: #c0c0c0;
44
+ background-color: black;
45
+ font-weight: 700;
46
+ font-family: sans-serif;
47
+ }
48
+ .tm {
49
+ vertical-align: super;
50
+ font-size: x-small;
51
+ }
52
+
53
+ h1 {
54
+ text-align: left;
55
+ background-color: #900;
56
+ color: #ebebeb;
57
+ padding: 5px .3em .5em .3em;
58
+ margin-top: 110px;
59
+ margin-bottom: 0;
60
+ }
61
+
62
+ h2 {
63
+ margin-top: 0;
64
+ margin-bottom: 0;
65
+ padding-left: .3em;
66
+ padding-right: .3em;
67
+ padding-bottom: .5em;
68
+ padding-top: .5em;
69
+ background-color: #545454;
70
+ color: white;
71
+ }
72
+
73
+ #toc ul {
74
+ padding-top: 1em;
75
+ padding-bottom: 1em;
76
+ list-style: none;
77
+ font-weight: bold;
78
+ }
79
+ #toc ul ul {
80
+ padding-top: 0;
81
+ list-style: square;
82
+ font-weight: normal;
83
+ }
84
+ #toc ul ul ul {
85
+ list-style: circle;
86
+ }
87
+
88
+ #Introduction {
89
+ background-color: #663;
90
+ margin-bottom: 1em;
91
+ }
92
+
93
+ #version {
94
+ padding-top: 1em;
95
+ margin-left: 0;
96
+ margin-right: 0;
97
+ }
98
+ /*]]>*/
99
+ </style>
100
+ </head>
101
+
102
+ <body>
103
+ <div id="logo">
104
+ <img alt="" src="ex/images/logo400x83.gif" />
105
+ </div>
106
+
107
+ <p id="magick">Ruby+ImageMagick<span class="tm">TM</span><br />
108
+ Ruby+GraphicsMagick</p>
109
+
110
+ <h1>User's Guide and Reference</h1>
111
+
112
+ <h2>Table of Contents</h2>
113
+
114
+ <div id="toc">
115
+ <ul>
116
+ <li><a href="#introduction">Introduction</a></li>
117
+
118
+ <li>Usage Guide</li>
119
+
120
+ <li style="list-style: none">
121
+ <ul>
122
+ <li><a href="usage.html">How to Use RMagick</a></li>
123
+
124
+ <li><a href="imusage.html">ImageMagick and GraphicsMagick
125
+ Conventions</a></li>
126
+
127
+ <li><a href="comtasks.html">Common Tasks</a></li>
128
+ </ul>
129
+ </li>
130
+
131
+ <li>Reference</li>
132
+
133
+ <li style="list-style: none">
134
+ <ul>
135
+ <li>Modules</li>
136
+
137
+ <li style="list-style: none">
138
+ <ul>
139
+ <li><a href="magick.html">Magick</a></li>
140
+ </ul>
141
+ </li>
142
+
143
+ <li>Classes</li>
144
+
145
+ <li style="list-style: none">
146
+ <ul>
147
+ <li><a href="ilist.html">ImageList</a></li>
148
+
149
+ <li><a href="imageattrs.html">Image (attribute
150
+ methods)</a></li>
151
+
152
+ <li><a href="image1.html">Image (class and instance
153
+ methods, part 1)</a></li>
154
+
155
+ <li><a href="image2.html">Image (instance methods,
156
+ part 2)</a></li>
157
+
158
+ <li><a href="image3.html">Image (instance methods,
159
+ part 3)</a></li>
160
+
161
+ <li><a href="draw.html">Draw</a></li>
162
+ </ul>
163
+ </li>
164
+
165
+ <li>
166
+ <a href="struct.html">Miscellaneous classes</a>
167
+
168
+ <ul>
169
+ <li><a href="struct.html#view">Image::View</a></li>
170
+
171
+ <li><a href="struct.html#Geometry">Geometry</a></li>
172
+
173
+ <li><a href="struct.html#Pixel">Pixel</a></li>
174
+
175
+ <li><a href="struct.html#struct">Struct
176
+ classes</a></li>
177
+
178
+ <li><a href="struct.html#fill">Fill classes</a></li>
179
+
180
+ <li><a href="struct.html#exception">Exception
181
+ classes</a></li>
182
+ </ul>
183
+ </li>
184
+
185
+ <li><a href="info.html">Image::Info - Optional method
186
+ arguments</a></li>
187
+
188
+ <li><a href="constants.html">Constants</a></li>
189
+ </ul>
190
+ </li>
191
+ </ul>
192
+ </div>
193
+
194
+ <h2 id="Introduction">Introduction</h2>
195
+
196
+ <h3>What is RMagick?</h3>
197
+
198
+ <p>RMagick is a binding from Ruby to the ImageMagick <span class=
199
+ "tm">TM</span> and GraphicsMagick image manipulation libraries.
200
+ Here's how the <a href=
201
+ "http://www.imagemagick.org/index.html">ImageMagick home page</a>
202
+ describes ImageMagick:</p>
203
+
204
+ <div class="imquote">
205
+ <p>ImageMagick<span style=
206
+ "font-size: x-small; vertical-align: super">TM</span>...is a
207
+ robust collection of tools and libraries...to read, write, and
208
+ manipulate an image in many image formats (over 90 major
209
+ formats) including popular formats like TIFF, JPEG, PNG, PDF,
210
+ PhotoCD, and GIF. With ImageMagick you can create images
211
+ dynamically, making it suitable for Web applications. You can
212
+ also resize, rotate, sharpen, color reduce, or add special
213
+ effects to an image and save your completed work in the same or
214
+ differing image format....A high-quality 2D renderer is
215
+ included, which provides a subset of SVG capabilities.</p>
216
+ </div>
217
+
218
+ <p>GraphicsMagick is a branch from ImageMagick 5.5.2 and provides
219
+ a nearly identical API. The <a href=
220
+ "http://www.graphicsmagick.org">GraphicsMagick web site</a> says
221
+ this about GraphicsMagick:</p>
222
+
223
+ <div class="imquote">
224
+ <p><em>GraphicsMagick</em> is a robust collection of tools and
225
+ libraries which support reading, writing, and manipulating an
226
+ image in over 88 major formats including popular formats like
227
+ TIFF, JPEG, JPEG-2000, PNG, PDF, PhotoCD, SVG, and GIF.
228
+ <em>GraphicsMagick</em> supports creating new images on the
229
+ fly, making it suitable for building dynamic Web applications.
230
+ GraphicsMagick may be used to resize, rotate, sharpen, color
231
+ reduce, or add special effects to an image and save the result
232
+ in the same or differing image format. Image processing
233
+ operations are available from the command line, as well as
234
+ through C, C++, Perl, Java, or COM programming interfaces.
235
+ Extensions are available from third-parties to support
236
+ programming in Borland's Delphi, Java, PHP, Python, Scheme, and
237
+ Ruby.</p>
238
+ </div>
239
+
240
+ <p>Both libraries offer a full range of image processing tools
241
+ that provide the capability to:</p>
242
+
243
+ <div class="imquote">
244
+ <ul>
245
+ <li>Convert an image from one format to another (e.g. TIFF to
246
+ JPEG)</li>
247
+
248
+ <li>Resize, rotate, sharpen, color reduce, or add special
249
+ effects to an image</li>
250
+
251
+ <li>Create a montage of image thumbnails</li>
252
+
253
+ <li>Create a transparent image suitable for use on the
254
+ Web</li>
255
+
256
+ <li>Turn a group of images into a GIF animation sequence</li>
257
+
258
+ <li>Create a composite image by combining several separate
259
+ images</li>
260
+
261
+ <li>Draw shapes or text on an image</li>
262
+
263
+ <li>Decorate an image with a border or frame</li>
264
+
265
+ <li>Describe the format and characteristics of an image</li>
266
+ </ul>
267
+ </div>
268
+
269
+ <p>RMagick is a complete interface to ImageMagick and
270
+ GraphicsMagick. Within its three major classes and 21 minor
271
+ classes RMagick defines over 550 methods and 225 constants.
272
+ RMagick exploits Ruby idioms such as blocks and iterators, Struct
273
+ classes, symbols, ?- and !-suffixed methods, and exceptions.</p>
274
+
275
+ <h3>About this document</h3>
276
+
277
+ <p>This document is divided into 3 parts. The first is this page.
278
+ The second part is a usage guide covering both RMagick and
279
+ ImageMagick/GraphicsMagick usage and conventions. The third, and
280
+ largest, is the reference guide, which describes all of the
281
+ RMagick classes and constants. The reference guide includes many
282
+ examples.</p>
283
+
284
+ <p>Accompanying the HTML documentation is a set of over 130
285
+ example RMagick programs. Each is a complete, stand-alone program
286
+ that either creates an image from scratch or modifies an input
287
+ image using one or more RMagick methods. The output images are
288
+ used as illustrations in the HTML documentation. Throughout this
289
+ document, click any example image to see the program that created
290
+ it.</p>
291
+
292
+ <h4>Conventions</h4>
293
+
294
+ <p><b>Names&nbsp;&nbsp;</b>I've tried to follow existing Ruby
295
+ conventions in this document. A class is identified by its name,
296
+ which always starts with a capital letter. An object is referred
297
+ to by its class name, starting with a small letter. For example,
298
+ a generic ImageList object is referred to as an
299
+ <em>imagelist</em>. In the Reference section, when a method
300
+ signature identifies the type of an argument or return value, the
301
+ type is shown by preceding the class name by "a" or "an". For
302
+ example, <code>anImage</code> refers to an Image object, and
303
+ <code>anImageList</code> refers to an ImageList object. Class
304
+ methods are identified like this: <code>Class.method</code>.
305
+ Instance methods are identified like this:
306
+ <code>Class#method</code>.</p>
307
+
308
+ <p>RMagick is implemented in the <b>Magick</b> module, therefore
309
+ its constants are in the Magick namespace. However, for clarity
310
+ I've omitted the <code>Magick::</code> prefix in most places in
311
+ this document. You can use the <code>include Magick</code>
312
+ statement to add the constants and methods to the Object
313
+ namespace.</p>
314
+
315
+ <p><b>References to ImageMagick and GraphicsMagick</b>&nbsp;
316
+ &nbsp;GraphicsMagick is a fork of ImageMagick and shares most of
317
+ its APIs. When describing a feature, API, convention, component,
318
+ or other element that is shared by both, I use the string
319
+ <b>&times;Magick</b>. For example, "&times;Magick supports over
320
+ 89 major image formats" means that both ImageMagick and
321
+ GraphicsMagick support over 89 formats.</p>
322
+
323
+ <p><b>&times;Magick documentation&nbsp;&nbsp;</b><span class=
324
+ "imquote">Text that looks like this</span> is quoted from the
325
+ &times;Magick documentation.</p>
326
+
327
+ <p><b>Example programs and images&nbsp;&nbsp;</b> All of the
328
+ example images on these pages were created by RMagick. Click the
329
+ image to see the progam code. (You may need to configure your
330
+ browser to allow JavaScript and popup windows.) All example
331
+ images show the result of applying the method. Many example
332
+ images show the "before" image as well. When the image is
333
+ accompanied by this symbol <img style="display:inline" src=
334
+ "ex/images/spin.gif" alt="rollover" /> mouse over the image to
335
+ see the "before" version.</p>
336
+
337
+ <h3>How to get help</h3>
338
+
339
+ <p>If you have a question that is not answered by these pages,
340
+ you can post it at the <a href=
341
+ "http://rubyforge.org/projects/rmagick">Support Request
342
+ Tracker</a> or the <a href=
343
+ "http://rubyforge.org/projects/rmagick">Feature Request
344
+ Tracker</a> on RubyForge, or email me at <code>rmagick at
345
+ rubyforge.org</code>.</p>
346
+
347
+ <h3><a name="bugs" id="bugs">Reporting bugs</a></h3>
348
+
349
+ <p>Please report problems with RMagick installation and usage to
350
+ the <a href="http://rubyforge.org/projects/rmagick/">Bug
351
+ Tracker</a> at RubyForge, or email me at <code>rmagick at
352
+ rubyforge.org</code>.</p>
353
+
354
+ <p>For quickest results, include the RMagick, &times;Magick and
355
+ Ruby version numbers, along with a thorough description of the
356
+ problem. RMagick will tell you both its version number and
357
+ &times;Magick's version number. Simply bring up irb and print the
358
+ <code>Magick::Long_version</code> constant:</p>
359
+ <pre class="example" id="version">
360
+ irb(main):001:0&gt; puts Magick::Long_version
361
+ This is RMagick 1.7.0 ($Date: 2004/12/08 12:15:31 $) Copyright (C) 2004 by Timothy P. Hunter
362
+ Built with GraphicsMagick 1.1.4 2004-11-13 Q8 http://www.GraphicsMagick.org/
363
+ Built for ruby 1.8.1 (2003-12-25) [i686-linux]
364
+ Web page: http://rmagick.rubyforge.org
365
+ Email: rmagick@rubyforge.org
366
+ </pre>
367
+
368
+ <p>It will help a lot if you supply a small Ruby program that
369
+ reproduces the problem. (Don't forget to include any input image
370
+ files!).</p>
371
+
372
+ <p>Please remember I can't help with Ruby or &times;Magick
373
+ installation and configuration problems. For help with Ruby, post
374
+ your questions to <code>comp.lang.ruby</code>. For help with
375
+ ImageMagick or GraphicsMagick, join the ImageMagick or
376
+ GraphicsMagick mailing list. See the instructions at <a href=
377
+ "http://www.imagemagick.org/www/magick-list.html">http://www.imagemagick.org/www/magick-list.html</a>
378
+ or <a href=
379
+ "http://sourceforge.net/projects/graphicsmagick/">http://sourceforge.net/projects/graphicsmagick/</a>.</p>
380
+
381
+ <p>I'm not an image processing guru, either, so I probably won't
382
+ be able to help with questions about specific image formats and
383
+ transformations. I will be glad, however, to translate between
384
+ the RMagick API and the &times;Magick C API to help you compose a
385
+ question to the &times;Magick developers.</p>
386
+
387
+ <h3>Contributions</h3>
388
+
389
+ <p>If you have a script or an image using RMagick that you're
390
+ particularly proud of, let me know. I'd like to collect your
391
+ contributions, along with other users' contributions, and put
392
+ them in a <code>contrib</code> directory to distribute with
393
+ RMagick. I'm particularly interested in getting examples for the
394
+ RMagick methods that currently have no examples.</p>
395
+
396
+ <h3><a name="copyrights" id="copyrights">Copyright
397
+ Notices</a></h3>
398
+
399
+ <ul>
400
+ <li>RMagick is copyright &copy; 2004 by Timothy P. Hunter.</li>
401
+
402
+ <li>ImageMagick is copyright &copy; 2004 ImageMagick
403
+ Studio.</li>
404
+
405
+ <li>GraphicsMagick is copyright &copy; 2004 GraphicsMagick
406
+ Group.</li>
407
+
408
+ <li>Ruby is copyrighted free software by Yukihiro
409
+ Matsumoto.</li>
410
+ </ul>
411
+
412
+ <div class="nav">
413
+ &laquo; <a href="index.html">Prev</a> | <a href=
414
+ "index.html">Contents</a> | <a href="usage.html">Next</a>
415
+ &raquo;
416
+ </div>
417
+ </body>
418
+ </html>